package com.axzhengxin.platform.business.controller;

import com.axzhengxin.platform.business.domain.BizApproveDetail;
import com.axzhengxin.platform.business.domain.BizApproveInfo;
import com.axzhengxin.platform.business.service.IBizApproveInfoService;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.utils.uuid.UUID;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.Date;
import java.util.List;

/**
 * @Author AHZJ0005
 * @Date 2021/2/25-10:07
 * 授信INFo 综合授信 Controller
 **/
@RestController
@RequestMapping("/business/bizApproveInfo")
public class BizApproveInfoController extends BaseController {

    @Autowired
    private IBizApproveInfoService bizApproveInfoService;

    /**
     * ---------------------------------
     * 查询授信info详情
     */
    @PreAuthorize("@ss.hasPermi('distribute:bizApproveInfo:getBizApproveInfo')")
    @RequestMapping("/getBizApproveInfo")
    public BizApproveInfo geBizApproveInfo(String approveId) {
        return bizApproveInfoService.geBizApproveInfo(approveId);
    }

    /**
     * ---------------------------------
     * 新增综合授信
     */
    @PreAuthorize("@ss.hasPermi('distribute:bizApproveInfo:insertApproveDetail')")
    @RequestMapping("/insertApproveDetail")
    public AjaxResult insertApproveDetail(BizApproveDetail bizApproveDetail) {
        return bizApproveInfoService.insertApproveDetail(bizApproveDetail);
    }


    /**
     * ---------------------------------
     * 删除综合授信
     */
    @PreAuthorize("@ss.hasPermi('distribute:bizApproveInfo:deleteBizApproveInfo')")
    @RequestMapping("/deleteBizApproveInfo")
    public AjaxResult deleteBizApproveInfoById(String approveDetailId) {
        return AjaxResult.success(bizApproveInfoService.deleteBizApproveInfoById(approveDetailId));
    }

    @RequestMapping("/insertApproveInfo")
    public AjaxResult inertApproveInfo(BizApproveInfo bizApproveInfo){
        return AjaxResult.success(bizApproveInfoService.insertApproveInfo(bizApproveInfo));

    }

}
